import { request } from '@umijs/max';

//  获取登录用户的token 值
export async function GetToken(options) {
  return request('/api/user/token/', 
  {
    method: 'POST',
    data: options
  });
}
//  获取登录用户的token 值 并记录登录时间
export async function Login(options) {
  return request('/api/user/login/', 
  {
    method: 'POST',
    data: options
  });
}

// 用户注册
export async function Register(options){
  return request('/api/user/register/',
    {
      method:'post',
      data:options
    }
  )
}

export async function GetCaptchaImg(){
  return request('/api/user/captcha/',{
    method:'get',
    responseType: 'blob',

  })
}

export async function PostCaptcha(options){
  return request('/api/user/captcha/',{
    method:'post',
    data:options
  })
}
// 发送邮箱校验链接
export async function PostEmailLink(options){
  return request('/api/user/emaillink/',{
    method:'post',
    data:options
  })
}

//  确认邮箱是否激活
export async function PostEmailActive(options){
  return request('/api/user/emailactive/',{
    method:'post',
    data:options
  })
}

// 发送邮箱验证码
export async function PostEmailCaptcha(options){
  return request('/api/user/emailcaptcha/',{
    method:'post',
    data:options
  })
}

// 验证邮箱验证码
export async function CheckoutEmailCaptcha(options){
  return request('/api/user/checkoutcaptcha/',{
    method:'post',
    data:options
  })
}